<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
		<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>
		<link rel="stylesheet" href="../js/easyui/themes/icon.css"/>
		<link rel="stylesheet" href="../js/easyui/themes/default/easyui.css" />
		<script type="text/javascript" src="../js/easyui/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="../js/ztree/jquery.ztree.all-3.5.js"></script>
		<link rel="stylesheet" href="../js/ztree/zTreeStyle.css"/>
		<script type="text/javascript">
			$(function(){
				var setting={
					data:{
						simpleData:{
							enable:true
						}
					},callback: {
						onClick:function(event,treeId,treeNode,clickFlag){
							var content = '<div style="width:100%;height:100%;overflow:hidden;">'
								+ '<iframe src="'
								+ treeNode.page
								+ '" scrolling="auto" style="width:100%;height:100%;border:0;" ></iframe></div>';
							if(treeNode.page != undefined && treeNode.page != ""){
								if($("#mytabs").tabs('exists',treeNode.name)){
									$("#mytabs").tabs('select',treeNode.name);
								}else{
									$("#mytabs").tabs('add',{
										title:treeNode.name,
										content:content,
										closable:true
									});
								}
							}
						}
					}
				};
				var zNodes=[
					{id:1,pId:0,name:"1"},
					{id:2,pId:0,name:"2"},
					{id:3,pId:1,name:"13"},
					{id:4,pId:2,name:"24"},
					{id:5,pId:1,name:"百度",page:"https://www.baidu.com"},
					{id:6,pId:1,name:"秘密",page:"https://www.baidu.com"}
				]
				$.fn.zTree.init($("#baseMenu"),setting,zNodes);	
				
				$("#mytabs").tabs({
					onContextMenu: function(e,title,index){
						e.preventDefault();
						
						$("#mm").menu('show',{
							left:e.pageX,
							top:e.pageY
						});
					}
				});
				/*$("#czbkLink").click(function(){
					$("#mytabs").tabs('add',{
						title:'传志博客',
						content:'123456678'
					});
					var pp=$('#mytabs').tabs('getSelected');
					var tab = pp.panel('options').tab;
					alert(tab.name());
					});*/
				});
		</script>
	</head>
	<body class="easyui-layout">
		<div data-options="region:'north',title:'bos物流管理系统'" style="height: 120px;">北部</div>
		<div data-options="region:'south',title:'法律信息'" style="height: 120px;">南部</div>
		<div data-options="region:'west',title:'系统菜单'" style="width: 120px;">
			<div class="easyui-accordion" data-options="fit:true">
				<!--<ul id="baseMenu" class="ztree"></ul>-->
				<div title="面板一"><a href="javascript:void(0)" id="czbkLink">传志播客</a></div>
				<div title="面板二">
					<ul id="baseMenu" class="ztree"></ul>
				</div>
			</div>
		</div>
		<div data-options="region:'east',title:'东部菜单'" style="width: 120px;">东部</div>
		<div data-options="region:'center'" style="height: 600px;">
			<div id="mytabs" class="easyui-tabs" data-options="fit:true">
				<div title="选项一">tab1</div>
				<div title="选项二" data-options="closable:true">tab2</div>
			</div>
		</div>
		<div id="mm" class="easyui-menu" style="width: 120px;">
			<div>关闭当前窗口</div>
			<div>关闭其它窗口</div>
			<div class="menu-sep"></div>
			<div data-options="iconCls:'icon-cancel'">关闭所有窗口</div>
		</div>
	</body>
</html>
